﻿<div class="blade-static">
    <div class="form-group">
        <div class="form-input __search">
            <input placeholder="Search keyword..." ng-model="searchText">
        </div>
        <p class="form-count">Count: <span class="count">{{filteredEntities.length}}</span></p>
    </div>
</div>
<div class="blade-content __medium-wide">
    <div class="blade-inner">
        <div class="inner-block">
            <div class="text" ng-if="blade.item.variations.length == 0">No Variations yet</div>
            <div class="table-wrapper" ng-show="blade.item.variations.length > 0">
                <table class="table">
                    <thead>
                        <tr>
                            <th class="table-col __product-control">
                                <label class="form-control __checkbox">
                                    <input type="checkbox" ng-model="selectedAll" ng-change="checkAll(selectedAll)" />
                                    <span class="check"></span>
                                </label>
                            </th>
                            <th class="table-col __product-img">Pic</th>
                            <th class="table-col __product-name">Name</th>
                            <th class="table-col __product-code">SKU</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="table-item" ng-repeat="data in blade.item.variations | filter:searchText as filteredEntities track by data.id" ng-class="{'__selected': data === selectedItem}">
                            <td class="table-col">
                                <label class="form-control __checkbox">
                                    <input type="checkbox" ng-model="data.selected">
                                    <span class="check"></span>
                                </label>
                            </td>
                            <td class="table-col" ng-click='selectVariation(data)'>
                                <div class="product-img">
                                    <div class="image" ng-style="{'background-image': 'url(' + data.imgSrc + ')' }" ng-if="data.imgSrc"></div>
                                    <i class="table-ico fa fa-image" ng-if="!data.imgSrc" />
                                </div>
                            </td>
                            <td class="table-col __product-name" ng-click='selectVariation(data)'>
                                {{data.name}}
                            </td>
                            <td class="table-col __product-code" ng-click='selectVariation(data)'>
                                {{data.code}}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>